package com.daohang361.imqq.ui.cinema;

import javax.swing.ImageIcon;
import javax.swing.JPanel;

import com.daohang361.imqq.resourse.ResourcesManagement;
import com.daohang361.imqq.ui.EIMTalkFrame;

/**
 * 
 */
public class RegulationCinemaJPanel extends JPanel {
	
	private WaitingCinemaJPanel myContainer;
    public RegulationCinemaJPanel() {
        initComponents();
    }
    

    private void initComponents() {
        video_Slider = new javax.swing.JSlider();
        voice_Slider = new javax.swing.JSlider();
        video_Label = new javax.swing.JLabel();
        voice_Label = new javax.swing.JLabel();
        closedvideo_jButton = new javax.swing.JButton();

        setBackground(new java.awt.Color(102, 204, 255));
        video_Slider.setBackground(new java.awt.Color(102, 204, 255));
        video_Slider.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                video_SliderStateChanged(evt);
            }
        });
        video_Slider.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                video_SliderPropertyChange(evt);
            }
        });

        voice_Slider.setBackground(new java.awt.Color(102, 204, 255));
        voice_Slider.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                voice_SliderStateChanged(evt);
            }
        });
        voice_Slider.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                voice_SliderPropertyChange(evt);
            }
        });

        video_Label.setBackground(new java.awt.Color(102, 204, 255));
        ImageIcon video_LabelImage=ResourcesManagement.getImageIcon("icon/cam_24.gif");
        video_Label.setIcon(video_LabelImage);
        ImageIcon voice_LabelImage=ResourcesManagement.getImageIcon("ui/microphone4.png");
        voice_Label.setIcon(voice_LabelImage);

        closedvideo_jButton.setBackground(new java.awt.Color(102, 204, 255));
        closedvideo_jButton.setText("\u5173\u95ed");
        closedvideo_jButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                closedvideo_jButtonMouseClicked(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(video_Label)
                    .addComponent(voice_Label))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(closedvideo_jButton)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addComponent(voice_Slider, javax.swing.GroupLayout.Alignment.LEADING, 0, 0, Short.MAX_VALUE)
                        .addComponent(video_Slider, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 89, Short.MAX_VALUE)))
                .addContainerGap(19, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(video_Label)
                    .addComponent(video_Slider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(voice_Slider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(voice_Label))
                .addGap(26, 26, 26)
                .addComponent(closedvideo_jButton)
                .addContainerGap(25, Short.MAX_VALUE))
        );
    }// </editor-fold>                        

    private void video_SliderPropertyChange(java.beans.PropertyChangeEvent evt) {                                            
// TODO 将在此处添加您的处理代码：
    }                                           

    private void voice_SliderStateChanged(javax.swing.event.ChangeEvent evt) {                                          
// TODO 将在此处添加您的处理代码：
    }                                         

    private void voice_SliderPropertyChange(java.beans.PropertyChangeEvent evt) {                                            
// TODO 将在此处添加您的处理代码：
    }                                           

    private void video_SliderStateChanged(javax.swing.event.ChangeEvent evt) {                                          
// TODO 将在此处添加您的处理代码：
    }                                         

    private void closedvideo_jButtonMouseClicked(java.awt.event.MouseEvent evt) {
    	
    	EIMTalkFrame.isViedoing=false;
    	myContainer.getParent().remove(myContainer);
    	
//		//----------操作消息----------//
//    	QQTalkFrame talkFrame=this.myContainer.getTalkFrameParent();
//    	String owerQQ= talkFrame.owerUser.getQq();
//		String destQQ=talkFrame.friend.getQq();
//		CinemaResponseMessage responseMessage=new CinemaResponseMessage(owerQQ,destQQ);
//		responseMessage.setCinemaResponse(MessageType.CinemaResponse_Decline);
//		ClientSendTextMessageProcess.getInstance().sendCinemaResponseMessage(responseMessage);
    }                                                
    
    
    // 变量声明 - 不进行修改                     
    public javax.swing.JButton closedvideo_jButton;
    private javax.swing.JLabel video_Label;
    private javax.swing.JSlider video_Slider;
    private javax.swing.JLabel voice_Label;
    private javax.swing.JSlider voice_Slider;
    // 变量声明结束                   
	public WaitingCinemaJPanel getMyContainer() {
		return myContainer;
	}

	public void setMyContainer(WaitingCinemaJPanel myContainer) {
		this.myContainer = myContainer;
	}
    
}
